package com.xbongbong.saas.domain.entity;

import com.xbongbong.paas.toolbox.util.DateTimeUtil;
import com.xbongbong.paas.toolbox.util.DateUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * @author WangJian
 * @date  2019-01-25 10:58
 **/
@Getter
@Setter
@ToString
public class ProductWarehouseEntity implements Serializable {

    private static final long serialVersionUID = -6974092723513950801L;
    /**
     * 分仓产品id
     */
    private Long id;
    /**
     * 公司id
     */
    private String corpid;
    /**
     * 仓库id
     */
    private Long warehouseId;
    /**
     * 仓库名
     */
    private String warehouseName;
    /**
     * 产品id(SPU的ID)
     */
    private Long parentId;
    /**
     * 产品id(对应的SKU的ID)
     */
    private Long productId;
    /**
     * 当前库存
     */
    private Double num;
    /**
     * 期初库存
     */
    private Double oriNum;
    /**
     * 添加时间
     */
    private Long addTime;
    /**
     * 更新时间
     */
    private Long updateTime;
    /**
     * 删除标志
     */
    private Integer del;

    /**
     * 是否预警
     */
    private Integer isNotify;
    /**
     * 库存上限
     */
    private Double stockUpperLimit;
    /**
     * 库存下限
     */
    private Double stockLowerLimit;

    /**
     * 成本（初始值是tb_product的cost）
     */
    private Double cost;

    /**
     * 是否被勾选
     */
    private Integer warehouseChecked;

    /**
     * 分仓唯一key
     */
    private String warehouseKey;

    /**
     * 总成本
     */
    private Double totalCost;

    public ProductWarehouseEntity() {
        this.warehouseChecked = 1;
        this.updateTime = DateTimeUtil.getInt();
        this.addTime = DateTimeUtil.getInt();
        this.del = 0;
    }

    public ProductWarehouseEntity(Integer isNotify, Double stockUpperLimit, Double stockLowerLimit) {
        this.warehouseChecked = 1;
        this.isNotify = isNotify;
        this.stockUpperLimit = stockUpperLimit;
        this.stockLowerLimit = stockLowerLimit;
        this.updateTime = DateTimeUtil.getInt();
        this.addTime = DateTimeUtil.getInt();
        this.del = 0;
    }
}
